﻿using System;
using System.Windows.Forms;

namespace WebForm
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(m_txtFrom.Text) || string.IsNullOrEmpty(m_txtTo.Text))
            {
                MessageBox.Show("Input Id Range!");
                return;
            }
            int from, to;
            if (!(int.TryParse(m_txtFrom.Text, out from) && int.TryParse(m_txtTo.Text, out to)))
            {
                MessageBox.Show("Input valie Id Range!");
                return;
            }
            int distance = (to - from) / 4;
            int from2 = from + distance + 1;
            int to2 = from2 + distance;
            int from3 = to2 + 1;
            int to3 = from3 + distance;

            m_browser1.FromId = from;
            m_browser1.ToId = from + distance;
            
            m_browser2.FromId = from2;
            m_browser2.ToId = to2;

            m_browser3.FromId = from3;
            m_browser3.ToId = to3;

            m_browser4.FromId = to3 + 1;
            m_browser4.ToId = to;

            m_browser1.Run();
            m_browser2.Run();
            m_browser3.Run();
            m_browser4.Run();
        }
        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            m_browser1.Stop();
            m_browser2.Stop();
            m_browser3.Stop();
            m_browser4.Stop();
            base.OnClosing(e);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            m_browser1.Stop();
            m_browser2.Stop();
            m_browser3.Stop();
            m_browser4.Stop();
        }
    }
    public class PeakbaggerMountain
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Prominence { get; set; }
        public string Elevation { get; set; }
        public string LongLat1 { get; set; }
        public string LongLat2 { get; set; }
        public string LongLat3 { get; set; }
        public string Country { get; set; }
        public string State { get; set; }
        public string Ownership { get; set; }
    }
}
